//****************************************************************
//* Copyright (c) 2004 Ford Motor Company. All Rights Reserved.
//*
//* $$Workfile:   MixTempStruct.java  $$
//* $$Revision:   1.0  $$
//* $$Author:   aponte  $$
//* $$Date:   Dec 10 2008 11:00:14  $$
//*
//*****************************************************************
package ar.com.ford.it.fullEconomics.struct;

import java.math.BigDecimal;
import ar.com.ford.it.fullEconomics.persistence.dto.Teesg01Plant;
import ar.com.ford.it.fullEconomics.persistence.dto.Teesp01Part;

public class MixTempStruct {

	private Teesp01Part teesp01Part;

	private BigDecimal fMixPieza;

	private BigDecimal fPorcentajeMixPieza;

	private BigDecimal fUsoPieza;

	private BigDecimal fUsoTotalPieza;

	/**
	 * Crea los objetos internos a partir de sus atributos directos
	 * 
	 * @param eesp08CatalModelyearCodeC
	 * @param eesp08CatalSeqCodeC
	 * @param eesp08CatalTmaCodeC
	 * @param eesp08PartBaseCodeC
	 * @param eesp08PartClassCodeC
	 * @param eesp08PartPrefixCodeC
	 * @param eesp08PartSuffixCodeC
	 * @param fQuantity
	 */
	public MixTempStruct(String eesp08PartBaseCodeC,
			String eesp08PartClassCodeC, String eesp08PartPrefixCodeC,
			String eesp08PartSuffixCodeC, Teesg01Plant plant) {

		this.teesp01Part = new Teesp01Part();
		this.teesp01Part.setEesp01PartBaseCodeC(eesp08PartBaseCodeC);
		this.teesp01Part.setEesp01PartClassCodeC(eesp08PartClassCodeC);
		this.teesp01Part.setEesp01PartSuffixCodeC(eesp08PartSuffixCodeC);
		this.teesp01Part.setEesp01PartPrefixCodeC(eesp08PartPrefixCodeC);
		this.teesp01Part.setEesp01PlantCodeC(plant);

	}

	public MixTempStruct() {
	}

	public Teesp01Part getTeesp01Part() {
		return teesp01Part;
	}

	public void setTeesp01Part(Teesp01Part teesp01Part) {
		this.teesp01Part = teesp01Part;
	}

	public BigDecimal getFMixPieza() {
		return fMixPieza;
	}

	public void setFMixPieza(BigDecimal mixPieza) {
		fMixPieza = mixPieza;
	}

	public BigDecimal getFPorcentajeMixPieza() {
		return fPorcentajeMixPieza;
	}

	public void setFPorcentajeMixPieza(BigDecimal porcentajeMixPieza) {
		fPorcentajeMixPieza = porcentajeMixPieza;
	}

	public BigDecimal getFUsoPieza() {
		return fUsoPieza;
	}

	public void setFUsoPieza(BigDecimal usoPieza) {
		fUsoPieza = usoPieza;
	}

	/**
	 * Compara las partes
	 */
	public boolean equals(Object objeto) {

		try {
			// Casteo el objeto
			MixTempStruct mixTempStruct = (MixTempStruct) objeto;

			// Obtengo la parte
			Teesp01Part teesp01Part2 = mixTempStruct.getTeesp01Part();

			if (teesp01Part2.getEesp01PartBaseCodeC().equals(
					this.teesp01Part.getEesp01PartBaseCodeC())
					&& teesp01Part2.getEesp01PartClassCodeC().equals(
							this.teesp01Part.getEesp01PartClassCodeC())
					&& teesp01Part2.getEesp01PartPrefixCodeC().equals(
							this.teesp01Part.getEesp01PartPrefixCodeC())
					&& teesp01Part2.getEesp01PartSuffixCodeC().equals(
							this.teesp01Part.getEesp01PartSuffixCodeC())) {
				return true;
			} else {
				return false;
			}

		} catch (Exception e) {
			return false;
		}
	}

	public BigDecimal getFUsoTotalPieza() {
		return fUsoTotalPieza;
	}

	public void setFUsoTotalPieza(BigDecimal usoTotalPieza) {
		fUsoTotalPieza = usoTotalPieza;
	}

}
